home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 August: Tool Chest / Dev.CD Aug 98 TC.toast / Tool Chest / Testing & Debugging / Mac OS Development Toolkit / Automation Essentials 2.3.0 / Host Automation Folder / SPEC Libs / Text.Lib < prev    next >
Encoding:
Text File  |  1998-03-19  |  3.7 KB  |  102 lines  |  [TEXT/MPS ]

  1. #
  2. # ****************************************************************************
  3. #
  4. #    File Name:        Text.Lib
  5. #
  6. #    Contains:    xxx put contents here xxx
  7. #
  8. #    Written by:    KTA, KL, ML, GS et al
  9. #
  10. #    Copyright:    © 1993-1995 by Apple Computer, Inc., all rights reserved.
  11. #
  12. # ****************************************************************************
  13. #            C h a n g e        H i s t o r y (most recent first):
  14. # ****************************************************************************
  15. #
  16. #        Vers      Date        Author        Description
  17. #        ----    --------    ------    ---------------------------------------------
  18. #     <1.0.3>      1/9/95    KTA        TypeParagraph() - Added pObjectNumber with default ''.
  19. #     <1.0.2>     12/6/94    ML        Added Exception Handling support
  20. #        <1+>     5/21/93    NAGA        Adding header and porting old files to follow new standards
  21. #
  22. # ****************************************************************************
  23. #
  24.  
  25. ########################################################################
  26. #                            External libraries 
  27. #=======================================================================
  28. Libraries "Font.Lib","String.Lib", "ExceptionHandling.Lib";
  29.  
  30.  
  31.  
  32. #########################################################################
  33. #                             TypeWord(pNumChars := 'Random')
  34. #=======================================================================
  35. # Author:          KTA 
  36. # Description:    Will type a string of random characters <pNumChars>
  37. #                in length.
  38. # Parameters:    pNumChars - Number of characters in the 'word' default 
  39. #                            is random length from 1 to 10 characters.
  40. # Example:        TypeWord();
  41. #=======================================================================
  42. # History:
  43. # ML    11/29/94    Added Exception Handling support
  44. #########################################################################
  45. TASK TypeWord(pNumChars := 'Random')
  46. begin
  47.     if (pNumChars = 'Random')
  48.     begin
  49.         randomWord := RandomString(Random(1,10));
  50.         _Type ({"{randomWord} "});
  51.     end;
  52. end;
  53.  
  54. #########################################################################
  55. #                             TypeSentence(pNumWords := 20)
  56. #=======================================================================
  57. # Author:          KTA 
  58. # Description:    Will type a sentence of random character strings <pNumWords>
  59. #                in length. 
  60. # Parameters:    pNumWords - Number of words in the sentence (default is 20)    
  61. # Example:        TypeSentence();    
  62. #=======================================================================
  63. # History:
  64. # ML    11/29/94    Added Exception Handling support
  65. #########################################################################
  66. TASK TypeSentence(pNumWords := 20) 
  67. begin
  68.     for i := 1 to pNumWords
  69.         TypeWord();
  70.     punctuationList :={'!',',','.','?',':',';'};
  71.     RandPunct := Random(1,(Card(punctuationList)));
  72.     whichPunct := punctuationList[RandPunct];
  73.     _Type ({whichPunct});
  74. end;
  75.  
  76. #########################################################################
  77. #                             TypeParagraph(pNumSentences := 6)
  78. #=======================================================================
  79. # Author:          KTA 
  80. # Description:    Will type a paragraph of sentences of random character strings <pNumSentences>
  81. #                in length. 
  82. # Parameters:    pNumSentences - Number of sentences in the paragraph (default is 6)    
  83. # Example:        TypeParagraph();    
  84. #=======================================================================
  85. # History:
  86. # ML    11/29/94 Added Exception Handling support
  87. # KTA    1/9/95     Added pObjectNumber with default ''
  88. #########################################################################
  89. TASK TypeParagraph(pNumSentences := 6,  pObjectNumber := '')
  90. begin
  91.     _Type ({tabKey});
  92.     for i := 1 to pNumSentences
  93.     begin
  94.         if(pObjectNumber = '')
  95.             pObjectNumber := i;
  96.         SetFontParams(RandomFontRecords(), , pObjectNumber);
  97.         TypeSentence();
  98.         _Type ({"  "});
  99.     end;
  100.     _Type ({returnKey, returnKey});
  101. end;
  102.